package org.createModel.prototype.test1;

import java.io.*;

public class Client {
    public static void main(String[] args) {

        Student student1 = new Student();
        student1.setName("张三");
        Citation citation1 = new Citation();
        citation1.setStudent(student1);


        try {
            ObjectOutputStream oos = new ObjectOutputStream(new FileOutputStream("E:\\IdeaProjects\\designModle\\design-modle\\src\\main\\java\\org\\createModel\\prototype\\test1\\clone.txt"));
            oos.writeObject(citation1);
            oos.close();

            ObjectInputStream ois = new ObjectInputStream(new FileInputStream("E:\\IdeaProjects\\designModle\\design-modle\\src\\main\\java\\org\\createModel\\prototype\\test1\\clone.txt"));
            Citation citation2 = (Citation)ois.readObject();
            ois.close();

            citation2.getStudent().setName("李四");

            citation1.show();
            citation2.show();
        } catch (Exception e) {
            throw new RuntimeException(e);
        }


    }
}
